home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 2).iso / 0038 / vc.zip / VC.CPP < prev    next >
C/C++ Source or Header  |  1996-01-20  |  4KB  |  138 lines

  1. // vc.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "vc.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "vcdoc.h"
  9. #include "vcview.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CVcApp
  18.  
  19. BEGIN_MESSAGE_MAP(CVcApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CVcApp)
  21.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25.     // Standard file based document commands
  26.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  27.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CVcApp construction
  32.  
  33. CVcApp::CVcApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CVcApp object
  41.  
  42. CVcApp NEAR theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CVcApp initialization
  46.  
  47. BOOL CVcApp::InitInstance()
  48. {
  49.     // Standard initialization
  50.     // If you are not using these features and wish to reduce the size
  51.     //  of your final executable, you should remove from the following
  52.     //  the specific initialization routines you do not need.
  53.  
  54.     SetDialogBkColor();        // Set dialog background color to gray
  55.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  56.     EnableVBX();               // Initialize VBX support
  57.  
  58.     // Register the application's document templates.  Document templates
  59.     //  serve as the connection between documents, frame windows and views.
  60.  
  61.     CSingleDocTemplate* pDocTemplate;
  62.     pDocTemplate = new CSingleDocTemplate(
  63.         IDR_MAINFRAME,
  64.         RUNTIME_CLASS(CVcDoc),
  65.         RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  66.         RUNTIME_CLASS(CVcView));
  67.     AddDocTemplate(pDocTemplate);
  68.  
  69.     // create a new (empty) document
  70.     OnFileNew();
  71.  
  72.     if (m_lpCmdLine[0] != '\0')
  73.     {
  74.         // TODO: add command line processing here
  75.     }
  76.  
  77.  
  78.     return TRUE;
  79. }
  80.  
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CAboutDlg dialog used for App About
  83.  
  84. class CAboutDlg : public CDialog
  85. {
  86. public:
  87.     CAboutDlg();
  88.  
  89. // Dialog Data
  90.     //{{AFX_DATA(CAboutDlg)
  91.     enum { IDD = IDD_ABOUTBOX };
  92.     //}}AFX_DATA
  93.  
  94. // Implementation
  95. protected:
  96.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  97.     //{{AFX_MSG(CAboutDlg)
  98.         // No message handlers
  99.     //}}AFX_MSG
  100.     DECLARE_MESSAGE_MAP()
  101. };
  102.  
  103. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  104. {
  105.     //{{AFX_DATA_INIT(CAboutDlg)
  106.     //}}AFX_DATA_INIT
  107. }
  108.  
  109. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  110. {
  111.     CDialog::DoDataExchange(pDX);
  112.     //{{AFX_DATA_MAP(CAboutDlg)
  113.     //}}AFX_DATA_MAP
  114. }
  115.  
  116. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  117.     //{{AFX_MSG_MAP(CAboutDlg)
  118.         // No message handlers
  119.     //}}AFX_MSG_MAP
  120. END_MESSAGE_MAP()
  121.  
  122. // App command to run the dialog
  123. void CVcApp::OnAppAbout()
  124. {
  125.     CAboutDlg aboutDlg;
  126.     aboutDlg.DoModal();
  127. }
  128.  
  129. /////////////////////////////////////////////////////////////////////////////
  130. // VB-Event registration
  131. // (calls to AfxRegisterVBEvent will be placed here by ClassWizard)
  132.  
  133. //{{AFX_VBX_REGISTER_MAP()
  134. //}}AFX_VBX_REGISTER_MAP
  135.  
  136. /////////////////////////////////////////////////////////////////////////////
  137. // CVcApp commands
  138.